﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using IndoReputation.Models.BusinessObject;
using IndoReputation.Models.BusinessObject.Collections;
using IndoReputation.Models.DataAccess;

namespace IndoReputation.Models.BusinessLogic
{
    public class StrongInfluenceTypeBOL
    {
        /// <summary>
        /// Author: Nguyen Duc Thanh Tung
        /// Created on: 4/22/2012  6:03 PM
        /// Todo: Insert an strongInfluenceType to db
        /// </summary>
        /// <param name="strongInfluenceType">The strongInfluenceType.</param>
        /// <returns></returns>
        public static int Insert(StrongInfluenceType strongInfluenceType)
        {
            try
            {
                strongInfluenceType.CreateAt = DateTime.Now;
                strongInfluenceType.CreateBy = MySession.UserID;
                strongInfluenceType.UpdateAt = null;
                strongInfluenceType.UpdateBy = null;
                return StrongInfluenceTypeDAL.Insert(strongInfluenceType);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }

        /// <summary>
        /// Author: Nguyen Duc Thanh Tung
        /// Created on: 11/30/2011  9:45 AM
        /// Todo: Update a User Exists in Database 
        /// </summary>
        /// <param name="strongInfluenceType">A strongInfluenceType.</param>
        /// <returns></returns>
        public static bool Update(StrongInfluenceType strongInfluenceType)
        {
            try
            {
                strongInfluenceType.UpdateAt = DateTime.Now;
                strongInfluenceType.UpdateBy = MySession.UserID;
                return StrongInfluenceTypeDAL.Update(strongInfluenceType);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }

        /// <summary>
        /// Author: Nguyen Duc Thanh Tung
        /// Created on: 11/30/2011  10:36 AM
        /// Todo: Delete a User Existst in Database
        /// </summary>
        /// <param name="strongInfluenceType">A strongInfluenceType.</param>
        /// <returns></returns>
        public static bool Delete(int strongInfluenceTypeID)
        {
            try
            {
                return StrongInfluenceTypeDAL.Delete(strongInfluenceTypeID);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }

        /// <summary>
        /// Author: Nguyen Duc Thanh Tung
        /// Created on: 11/29/2011  5:23 PM
        /// Todo: Get All StrongInfluenceType
        /// </summary>
        /// <returns></returns>
        public static StrongInfluenceTypeList GetAllStrongInfluenceType()
        {
            try
            {
                return StrongInfluenceTypeDAL.GetAllStrongInfluenceType() ?? new StrongInfluenceTypeList();
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }

        /// <summary>
        /// Author: Nguyen Duc Thanh Tung
        /// Created on: 11/30/2011  10:40 AM
        /// Todo: Select a User existst in Database
        /// </summary>
        /// <param name="strongInfluenceTypeID">The strongInfluenceType ID.</param>
        /// <returns></returns>
        public static StrongInfluenceType GetStrongInfluenceTypeById(int strongInfluenceTypeID)
        {
            try
            {
                return StrongInfluenceTypeDAL.GetStrongInfluenceTypeById(strongInfluenceTypeID);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
    }
}